package com.jin.service.Impl;

import com.alibaba.fastjson.JSON;
import com.jin.mapper.UserInfoLevelMapper;
import com.jin.mapper.UserInfoMapper;
import com.jin.pojo.UserInfo;
import com.jin.pojo.UserLevel;
import com.jin.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserInfoServiceImpl implements UserInfoService {
    @Autowired
    UserInfoMapper userInfoMapper;
    @Autowired
    UserInfoLevelMapper userInfoLevelMapper;
    @Override
    public int insertUserInfo(UserInfo userInfo) {
        int i = userInfoMapper.insertUserInfo(userInfo);
        return i;
    }

    @Override
    public int delUserById(Integer userId) {
        return userInfoMapper.delUserById(userId);
    }

    @Override
    public int updateUserInfo(UserInfo userInfo) {
        return userInfoMapper.updateUserInfo(userInfo);
    }

    @Override
    public List<UserInfo> selectUser() {
        return userInfoMapper.selectUser();
    }

    @Override
    public UserInfo selectUserInfoLevel(Integer userId) {
        return userInfoMapper.selectUserInfoLevel(userId);
    }

    @Override
    public UserInfo loginUser(String userAccount, String userPassword) {
        return userInfoMapper.loginUser(userAccount,userPassword);
    }


}
